Retrieving Backup Locations
A sample SessionToken will be used throughout this use case.
The sample SessionToken will be: e65aedeb-a0e7-440c-8309-1cc0bcd920dbBase URLs are required depending on the version of VM Backup being used. <base_url> for each version is:
V8.x: http://localhost:35113/api
V9.0.x: http://localhost:36015/api
V9.1.x: http://localhost:36013/api/rest
The client can ask the API to provide a list of backup locations. It can also ask it to provide a list of backup locations which are assigned to a specific VM. Apart from this, additional parameters can be supplied in order to specify whether only backup locations, or only offsite locations should be retrieved. It can also retrieve both backup and offsite locations in a single call. VMs can also be assigned or un-assigned to a particular backup and offsite location.
The following GET request retrieves a list of all backup and offsite locations:
<base_url>/backuplocations/e65aedeb-a0e7-440c-8309-1cc0bcd920db
The following GET request retrieves only primary backup locations, without offsite locations
<base_url>/backuplocations/e65aedeb-a0e7-440c-8309-1cc0bcd920db/1/0
The following GET request retrieves only offsite locations, without primary backup locations
<base_url>/backuplocations/e65aedeb-a0e7-440c-8309-1cc0bcd920db/0/1
Once a BackupLocationId has been retrieved by any of the above calls, a VM can be assigned to it. As mentioned above, it is hereby assumed that a VM has already been added to the configuration. The AltaroVirtualMachineRef can be found further up in this document. The BackupLocationId that is going to be used for the illustration is the following:
BackupLocationId: e52edf12-a762-4602-a6d7-bc2386321b84
The following POST request adds a previously configured VM to a backup location:
<base_url>/vms/backuplocations/e65aedeb-a0e7-440c-8309-1cc0bcd920db/ ba2e9cdc-0d85-48e6-8db7-a45c5a40819e/e52edf12-a762-4602-a6d7-bc2386321b84
This same call can be altered to a DELETE request and in turn, the VM would be un-assigned from the backup location. This means that if the above POST call is made, and is then followed by a DELETE call, the VM Backup configuration would return to the same state which it was before the POST request was made.
Note: A full list of available API commands can be found here